home *** CD-ROM | disk | FTP | other *** search
/ Deutsche Edition 1 / Deutsche Edition 1.iso / amok / 081-090 / amok82 / plot / source / reqd.def < prev    next >
Encoding:
Modula Definition  |  1993-11-04  |  17.1 KB  |  366 lines

  1. (* ReqD.def       ported to M2Amiga 4.0 1991 by Jürgen Zimmermann  *)
  2. (* Req.mod        ported to Oberon 1990 by Achim Siebert           *)
  3. (* reqlibrary.h © 1988/1989 reserved by Colin Fox and Bruce Dawson *)
  4.  
  5. DEFINITION MODULE ReqD;
  6. (*$ Implementation:=FALSE *)
  7.  
  8. IMPORT E: ExecD,
  9.        I: IntuitionD,
  10.        G: GraphicsD,
  11.        D: DosD,
  12.        S: SYSTEM;
  13.  
  14. CONST reqName       = "req.library";
  15.       reqMinVersion = 1;
  16.  
  17.       numpairs      = 9; (* ARRAY[0..numpairs] OF... anstatt ARRAY numpairs OF...
  18.                             in Oberon *)
  19.  
  20.  
  21. TYPE GadgetBlockPtr = POINTER TO GadgetBlock;
  22.  
  23. TYPE GadgetBlock = RECORD
  24.                       gadget: I.Gadget;
  25.                       border: I.Border;
  26.                       pairs : ARRAY [0..numpairs] OF INTEGER;
  27.                       text  : I.IntuiText;
  28.                    END;
  29.  
  30. TYPE StringBlockPtr = POINTER TO StringBlock;
  31.  
  32. TYPE StringBlock = RECORD
  33.                       gadget: I.Gadget;
  34.                       info  : I.StringInfo;
  35.                       border: I.Border;
  36.                       pairs : ARRAY [0..numpairs] OF INTEGER;
  37.                    END;
  38.  
  39. TYPE PropBlockPtr  = POINTER TO PropBlock;
  40.  
  41. TYPE PropBlock  = RECORD
  42.    gadget         : I.Gadget;
  43.    info           : I.PropInfo;
  44.    image          : I.Image;
  45. END;
  46.  
  47. TYPE ScrollBlockPtr  = POINTER TO ScrollBlock;
  48.  
  49. TYPE ScrollBlock  = RECORD
  50.    arrowUpLt      : I.Gadget;
  51.    imageUpLt      : I.Image;
  52.    arrowDnRt      : I.Gadget;
  53.    imageDnRt      : I.Image;
  54.    prop           : I.PropInfo;
  55. END;
  56.  
  57. TYPE TwoImageGadgetPtr  = POINTER TO TwoImageGadget;
  58.  
  59. TYPE TwoImageGadget  = RECORD
  60.    gadget         : I.Gadget;
  61.    image1         : I.Image;
  62.    image2         : I.Image;
  63. END;
  64.  
  65. CONST
  66.        VERTSLIDER   = 16;  (* Default: Horizontal Slider*)
  67.  
  68.  
  69. (*This structure is used with the TextRequester function.*)
  70.  
  71. TYPE TRStructurePtr  = POINTER TO TRStructure;
  72.  
  73. TYPE TRStructure  = RECORD
  74.    text           : S.ADDRESS;   (* This is the message text, including printf() style formatting if desired.*)
  75.    controls       : S.ADDRESS;   (* This is the address of the parameter list, if printf() style formatting is used. *)
  76.    window         : I.WindowPtr; (* This is an optional (zero if not used) pointer to a window on the screen you*)
  77.                                   (* would like the requester to show up on.*)
  78.    middleText     : S.ADDRESS;   (* If non-zero, this is the text for the gadget in the lower middle (returns 2).*)
  79.    positiveText   : S.ADDRESS;   (* If non-zero, this is the text for the gadget in the lower left hand corner (returns 1).*)
  80.    negativeText   : S.ADDRESS;   (* If non-zero, this is the text for the gadget in the lower right (returns 0).*)
  81.    title          : S.ADDRESS;   (* This is the title for the window.*)
  82.    keyMask        : S.BITSET;    (* This is the qualifier mask for the keyboard shortcuts.*)
  83.                                   (* Use -1 to allow any qualifiers (or none).*)
  84.                                   (* Zero means that no keyboard shortcuts are allowed.*)
  85.    textcolor      : INTEGER;     (* Color of the text.  Uses color 1 if no color specified.*)
  86.    detailcolor    : INTEGER;     (* Detail and block color, as in a NewWindow structure.  If*)
  87.    blockcolor     : INTEGER;     (* both are left zero, block pen will be set to 1.*)
  88.    versionnumber  : INTEGER;     (* Make SURE this is set to zero.*)
  89.    rfu1           : LONGINT;     (* Make SURE you leave these two zeroed also.*)
  90.    rfu2           : LONGINT;     (* Make SURE you leave these two zeroed also.*)
  91. END;
  92.  
  93. (*NOTE:
  94.     The  control  values  mentioned above are used if you choose to insert
  95. printf  style directives in your strings and should contain the address of
  96. a list of control parameters, usually on the stack.
  97.    *)
  98.  
  99. (*         Remember,   if  you  don't  want  to  go  through  the  hassle  of*)
  100. (* initializing a ExtendedColorRequester structure, you can always just call *)
  101. (* ColorRequester  (as opposed to ExtendedColorRequester).  ColorRequester   *)
  102. (* just  takes  a  single  parameter, in D0, the color that should start out *)
  103. (* being highlit.  It returns a single value, the color that was selected at *)
  104. (* the end.*)
  105.  
  106. (*         This structure is for use with the ExtendedColorRequester (_not_, *)
  107. (* the ColorRequester) function.*)
  108.  
  109. TYPE ExtendedColorRequesterPtr  = POINTER TO ExtendedColorRequester;
  110.  
  111. TYPE ExtendedColorRequester  = RECORD
  112.    defcolor       : LONGINT;     (*The color that is initially highlit.   *)
  113.    window         : I.WindowPtr; (*The window the 'requester' opens up in.*)
  114.    rfu1           : LONGINT;     (*Who knows what these will be used for, *)
  115.    rfu2           : LONGINT;     (*but I'm sure we'll think of something. *)
  116.    rfu3           : LONGINT;     (*Until then, just keep these zeroed.    *)
  117.    rfu4           : LONGINT;     (*Okay?*)
  118.    rfu5           : LONGINT;
  119. END;
  120.  
  121. (*         This structure is for use with the GetLong function.*)
  122.  
  123. CONST glnodefault  = 0;(*Set this bit in the flags if you don't want a default*)
  124.                         (*value to show up in the get long string gadget.  For*)
  125.                         (*some things this is much better than having a zero  *)
  126.                         (*show up.*)
  127.  
  128. TYPE GetLongStructPtr  = POINTER TO GetLongStruct;
  129.  
  130. TYPE GetLongStruct  = RECORD
  131.    titlebar       : S.ADDRESS;
  132.    defaultval     : LONGINT;
  133.    minlimit       : LONGINT;
  134.    maxlimit       : LONGINT;
  135.    result         : LONGINT;
  136.    window         : I.WindowPtr;
  137.    versionnumber  : INTEGER; (* Make SURE this is set to zero.*)
  138.    flags          : S.LONGSET; (* Some, uh flags.  See above for bit definitions.*)
  139.    rfu2           : LONGINT;
  140.  
  141.    (* Make SURE you leave these two zeroed also.*)
  142. END;
  143.  
  144. TYPE GetStringStructPtr  = POINTER TO GetStringStruct;
  145.  
  146. TYPE GetStringStruct  = RECORD
  147.    titlebar       : S.ADDRESS;
  148.    stringbuffer   : S.ADDRESS;
  149.    window         : I.WindowPtr;
  150.    stringsize     : INTEGER; (*how many characters in the buffer*)
  151.    visiblesize    : INTEGER; (*how many characters show on screen*)
  152.    versionnumber  : INTEGER;
  153.    flags          : S.LONGSET;
  154.    rfu1           : LONGINT;
  155.    rfu2           : LONGINT;
  156.    rfu3           : LONGINT;
  157. END;
  158.  
  159. CONST dsize       = 130;
  160.       fchars      =  30;
  161.       wildlength  =  30;
  162.  
  163. TYPE DirString       = ARRAY[0..dsize] OF CHAR;
  164.      DirStringPtr    = POINTER TO DirString;
  165.      FileString      = ARRAY[0..fchars] OF CHAR;
  166.      FileStringPtr   = POINTER TO FileString;
  167.      PathString      = ARRAY[0..dsize+fchars+1] OF CHAR;
  168.      PathStringPtr   = POINTER TO PathString;
  169.      ShowHideString  = ARRAY[0..wildlength + 2] OF CHAR;
  170. (*
  171.    These  are  the  bit  numbers  of various bits that you can set in the
  172. Flags  field of the file requester structure.  The actual values that come
  173. out of these bit numbers are defined in the set of includes below with the
  174. same  names  but  with  an  M  (for  mask) ending instead of a B (for bit)
  175. ending.
  176.   *)
  177.  
  178. (*TYPE UmmFlags = (showinfo,extselect,caching,getfonts,
  179.                   infogadget,hidewilds,absolutexy,cachepurge,
  180.                   nohalfcache,nosort,nodrag,saving,
  181.                   loading,dironly,umm14,umm15,
  182.                   umm16,umm17,umm18,umm19,
  183.                   umm20,umm21,umm22,umm23,
  184.                   umm24,umm25,umm26,umm27,
  185.                   umm28,umm29,umm30,umm31);
  186.       UmmFlagSet = SET OF UmmFlags;
  187. *)
  188. CONST
  189.      showinfo    = 0;  (*Set this in Flags if you want .info files to show.  They default to hidden.*)
  190.      extselect   = 1;  (*Set this in Flags if you want extended select.  Default is not.*)
  191.      caching     = 2;  (*Set this in Flags if you want directory caching.  Default is not.*)
  192.      getfonts    = 3;  (*Set this in Flags if you want a font requester rather than a file requester.*)
  193.      infogadget  = 4;  (*Set this in Flags if you want a hide-info files gadget.*)
  194.      hidewilds   = 5;  (*Set this in Flags if you DON'T want 'show' and 'hide' string gadgets.*)
  195.      absolutexy  = 6;  (*Use absolute x,y positions rather than centering on mouse.*)
  196.      cachepurge  = 7;  (*Purge the cache whenever the directory date stamp changes if this is set.*)
  197.      nohalfcache = 8;  (*Don't cache a directory unless it is completely read in when this is set.*)
  198.      nosort      = 9;  (*Set this in Flags if you DON'T want sorted directories.*)
  199.      nodrag      = 10; (*Set this in Flags if you DON'T want a drag bar and depth gadgets.*)
  200.      saving      = 11; (*Set this bit if you are selecting a file to save to.*)
  201.      loading     = 12; (*Set this bit if you are selecting a file(s) to load from.*)
  202.                         (*These two bits (save and load) aren't currently used for*)
  203.                         (*anything, but they may be in the future, so you should*)
  204.                         (*remember to set them.  Also, these bits make it easier if*)
  205.                         (*somebody wants to customize the file requester for their*)
  206.                         (*machine.  They can make it behave differently for loading*)
  207.                         (*vs saving.*)
  208.      dironly     = 13; (*Allow the user to select a directory, rather than a file.*)
  209.  
  210.  
  211.  
  212. TYPE ESStructurePtr   = POINTER TO ESStructure;
  213.  
  214. TYPE ESStructure  = RECORD
  215.    nextFile       : ESStructurePtr;
  216.    nameLength     : INTEGER; (*Length of the filename field, not including the terminating zero.*)
  217.    pad            : INTEGER;
  218.    node           : S.ADDRESS;     (*For internal use only.*)
  219.    thefilename    : ARRAY[0..255] OF CHAR; (*This is (was) a variable size field.*)
  220. END;
  221.  
  222. TYPE FileRequesterPtr   = POINTER TO FileRequester;
  223.  
  224. TYPE FileRequester  = RECORD
  225.    versionNumber    : INTEGER;  (*Make sure this is zeroed for now.*)
  226.    title          : S.ADDRESS;  (*Hailing text*)
  227.    dir            : DirStringPtr;  (*Directory array (DSIZE+1)*)
  228.    file           : FileStringPtr; (*Filename array (FCHARS+1)*)
  229.    pathName       : PathStringPtr; (*Complete path name array (DSIZE+FCHARS+2)*)
  230.    window         : I.WindowPtr;   (*Window requesting or NULL*)
  231.  
  232.    maxExtendedSelect   : INTEGER;  (*Zero implies a maximum of 65535, as long as FRQEXTSELECT is set.*)
  233.    numlines            : INTEGER;  (*Number of lines in file window.*)
  234.    numcolumns          : INTEGER;  (*Number of columns in file window.*)
  235.    devcolumns          : INTEGER;
  236.    flags               : S.LONGSET; (*UmmFlagSet;*) (*Various - umm - flags.  See above for more info.*)
  237.    dirnamescolor       : INTEGER;  (*These five colors will all default*)
  238.    filenamescolor      : INTEGER;  (*to color one if you don't specify*)
  239.    devicenamescolor    : INTEGER;  (*a color (ie; if you specify color zero).*)
  240.    fontnamescolor      : INTEGER;  (*If you want color zero to be used, specify*)
  241.    fontsizescolor      : INTEGER;  (*color 32, or some other too large number*)
  242.                                     (*which mods down to zero.*)
  243.    detailcolor         : INTEGER;  (*If both of these colors are specified as*)
  244.    blockcolor          : INTEGER;  (*zero then the block pen will be set to one.*)
  245.  
  246.    gadgettextcolor       : INTEGER;   (*The color for the text of the five boolean gadgets.  Defaults to 1.*)
  247.    textmessagecolor      : INTEGER;   (*The color for the message at the screen top.  Defaults to 1.*)
  248.    stringnamecolor       : INTEGER;   (*The color for the words Drawer, File, Hide and Show.  Defaults to 3.*)
  249.    stringgadgetcolor     : INTEGER;   (*The color for the borders of the string gadgets.  Defaults to 3.*)
  250.                                        (*Unfortunately it is not possible to specify*)
  251.                                        (*the color of the actual text in an Intuition*)
  252.                                        (*string gadget.*)
  253.    boxbordercolor        : INTEGER;   (*The color for the boxes around the file and directory areas.  Defaults to 3.*)
  254.    gadgetboxcolor        : INTEGER;   (*The color for the boxes around the five boolean gadgets.  Defaults to 3.*)
  255.  
  256.    stuff                 : ARRAY[0..17] OF INTEGER; (*This area, which is reserved for*)
  257.                                                  (*future use, should all be zero.*)
  258.  
  259.    dirDateStamp          : D.Date; (*A copy of the cached directories date stamp.*)
  260.                                       (*There should never be any need to change this.*)
  261.  
  262.    windowLeftEdge        : INTEGER;  (*These two fields are only used when the*)
  263.    windowTopEdge         : INTEGER;  (*FRQABSOLUTEXY flag is set.  They specify*)
  264.                                       (*the location of the upper left hand*)
  265.                                       (*corner of the window.*)
  266.  
  267.    fontYSize          : INTEGER;     (*These fields are used to return the selected*)
  268.    fontStyle          : INTEGER;     (*font size and style, only applicable when the*)
  269.                                       (*font bit is set.*)
  270.  
  271.    (*If you set the extended select bit and the user extended selects, the list of filenames will start from here.*)
  272.    extendedSelect         : ESStructurePtr;
  273.    hide                   : ShowHideString; (*The wildcards text.*)
  274.    show                   : ShowHideString; (*More wildcards text.*)
  275.    fileBufferPos          : INTEGER; (*Various fields taken from the various*)
  276.    fileDispPos            : INTEGER; (*string gadgets so that the cursor*)
  277.    dirBufferPos           : INTEGER; (*can be returned to the same position*)
  278.    dirDispPos             : INTEGER; (*on subsequent calls.*)
  279.    hideBufferPos          : INTEGER;
  280.    hideDispPos            : INTEGER;
  281.    showBufferPos          : INTEGER;
  282.    showDispPos            : INTEGER;
  283.  
  284. (*     The  following  fields are PRIVATE!  Don't go messing with them or
  285.   wierd  things may/will happen.  If this isn't enough of a warning, go read
  286.   the one in intuition.h, that should scare you off.  *)
  287.  
  288.    memory  : S.ADDRESS;    (*Memory allocate for dir entries.   *)
  289.    memory2 : S.ADDRESS;    (*More memory, used for hidden files.*)
  290.    lock    : S.ADDRESS;
  291.    privateDirBuffer : ARRAY[0..dsize+1] OF CHAR; (*Used for keeping a record of which*)
  292.                                              (*directory we have file names for.*)
  293.    fileInfoBlock : D.FileInfoBlock;
  294.    numEntries        : INTEGER;
  295.    numHiddenEntries  : INTEGER;
  296.    filestartnumber   : INTEGER;
  297.    devicestartnumber : INTEGER;
  298. END;
  299.  
  300. (*       This is used with the RealTimeScroll function.*)
  301.  
  302. TYPE ScrollStructPtr  = POINTER TO ScrollStruct;
  303.  
  304. TYPE ScrollStruct  = RECORD
  305.    topEntryNumber   : LONGINT; (*This is the ordinal number of the first*)
  306.                                 (*displayed entry.*)
  307.    numEntries       : LONGINT; (*This is the total number of entries in*)
  308.                                 (*the list.*)
  309.    lineSpacing      : INTEGER; (*This is how many pixels high each entry is.*)
  310.    numLines         : LONGINT; (*This is how many entries can be displayed simultaneously.*)
  311.    propGadget       : I.Gadget;(*This is a pointer to the prop gadget being monitored.*)
  312.  
  313.    RedrawAll  : PROCEDURE(); (*This routine is used to redraw all of the*)
  314.                               (*entries when the user moves far enough*)
  315.                               (*that scrolling will take too long.*)
  316.  
  317.    ReadMore   : PROCEDURE(); (*An optional routine that is called when*)
  318.                               (*the scroll routine is waiting for movement.*)
  319.                               (*This allows reading of new data while real*)
  320.                               (*time scrolling.*)
  321.    ScrollAndDraw   : PROCEDURE(); (*This routine is called when the data needs*)
  322.                               (*to be scrolled and updated.  This routine is*)
  323.                               (*passed four long parameters (on the stack and*)
  324.                               (*in D0-D3) which are, respectively:*)
  325.                               (*D0 - entry number of first line to be drawn.*)
  326.                               (*D1 - pixel offset to draw first line at.*)
  327.                               (*D2 - amount to scroll before doing any drawing.*)
  328.                               (*D3 - number of lines of data to draw.*)
  329.    versionnumber  : INTEGER; (*Make SURE this is set to zero.*)
  330.    rfu1       : LONGINT;     (*Make SURE you leave these two zeroed also.*)
  331.    rfu2       : LONGINT;     (*Make SURE you leave these two zeroed also.*)
  332. END;
  333.  
  334. TYPE ChipstuffPtr   = POINTER TO Chipstuff;
  335.  
  336. TYPE Chipstuff  = RECORD
  337.    arrowUp      : ARRAY[0..9] OF INTEGER; (*16 pixels wide, 10 pixels high.*)
  338.    arrowDown    : ARRAY[0..9] OF INTEGER; (*16 pixels wide, 10 pixels high.*)
  339.    arrowLeft    : ARRAY[0..8] OF INTEGER; (*16 pixels wide, 9 pixels high. *)
  340.    arrowRight   : ARRAY[0..8] OF INTEGER; (*16 pixels wide, 9 pixels high. *)
  341.    letterR      : ARRAY[0..9] OF INTEGER; (*16 pixels wide, 10 pixels high.*)
  342.    letterG      : ARRAY[0..9] OF INTEGER; (*16 pixels wide, 10 pixels high.*)
  343.    letterB      : ARRAY[0..9] OF INTEGER; (*16 pixels wide, 10 pixels high.*)
  344.    letterH      : ARRAY[0..9] OF INTEGER; (*16 pixels wide, 10 pixels high.*)
  345.    letterS      : ARRAY[0..9] OF INTEGER; (*16 pixels wide, 10 pixels high.*)
  346.    letterV      : ARRAY[0..9] OF INTEGER; (*16 pixels wide, 10 pixels high.*)
  347. END;
  348.  
  349. TYPE ReqLibPtr   = POINTER TO  ReqLib;
  350.  
  351. TYPE ReqLib  = RECORD
  352.    rLib            : E.LibraryPtr;
  353.    sysLib          : E.ExecBasePtr;
  354.    dosLib          : D.DosLibraryPtr;
  355.    intuiLib        : I.IntuitionBasePtr;
  356.    gfxLib          : G.GfxBasePtr;
  357.    segList         : S.BPTR;
  358.    images          : ChipstuffPtr;
  359.    flags           : S.BITSET;
  360.    pad             : S.BITSET;
  361.    consoleDev      : S.ADDRESS;   (*Not really a char, but it should work*)
  362.    consoleHandle   : E.IOStdReqPtr;
  363. END;
  364.  
  365. END ReqD.
  366.